{% extends 'base.html' %}
{% block title %}虚拟主机信息{% endblock %}
{% block content %}
<div id="page-wrapper">
    <div class="row">
        <div class="col-lg-12">
            <h3 class="page-header">{% if server_ip %}宿主机({{ server_ip }}) {% endif %}虚拟主机信息</h3>
        </div>
    </div>
    <div class="row">
        <div class="col-lg-12">
            <ul class="nav nav-tabs">
                <li class="active"><a href="/cmdb/host_table/">查看主机</a>
                </li>
                <li><a href="/cmdb/host_add_html/">添加主机</a>
                </li>
                <li><a href="/cmdb/host_update_html/">修改主机</a>
                </li>
            </ul>
            {% if error %}
                <div class="alert alert-danger">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                    {{ error }}
                </div>
            {% endif %}
            {% if success %}
                <div class="alert alert-success">
                    <a href="#" class="close" data-dismiss="alert">&times;</a>
                        {{ success }}
                </div>
            {% endif %}

            <div class="tab-content">
                <div class="tab-pane fade in active">
 					<div class="row">
                				<div class="panel-heading" style="background-color: white">
                    				<B class="fa fa-th"> 主机信息表</B>
                                    <div style="float: right;">
                                        <a href="/cmdb/server_collect/{% if server_id %}{{ server_id }}{% else %}0{% endif %}/?ip=*" class="fa fa-hand-o-right">收集所有主机</a>
                                        <a href="/cmdb/asset_table/" class="fa fa-hand-o-right">返回列表</a>
                                        <a href="/cmdb/host_add_html/?server_ip={{ server_ip }}" class="fa fa-plus-square">新增</a>
                                    </div>
                				</div>
                				<div class="panel-body">
                    				<div class="dataTable_wrapper">
                        				<table class="table table-striped table-bordered table-hover" id="dataTables-example">
                            				<thead>
                                				<tr>
                                    				<th>宿主IP</th>
                                    				<th>主机IP</th>
                                    				<th>主机状态</th>
                                    				<th>应用</th>
                                    				<th>主机名</th>
                                    				<th>系统版本</th>
                                    				<th>CPU核数</th>
                                    				<th>内存大小(M)</th>
                                    				<th>备注</th>
                                                    <th>管理</th>
                                				</tr>
                            				</thead>
                            				<tbody>

                            				{% for i in b %}
                                				<tr class="gradeA">
                                    				<td>{{ i.host_ip }}</td>
                                    				<td>{{ i.local_ip }}</td>
                                    				<td>{{ i.status }}</td>
                                    				<td>{{ i.app }}</td>
                                    				<td>{{ i.host_name }}</td>
                                    				<td>{{ i.system_version }}</td>
                                    				<td>{{ i.cpu_num }}</td>
                                    				<td>{{ i.mem_size }}</td>
                                    				<td class="center">{{ i.host_note }}</td>
                                                    <td>
                                                        <a href="/cmdb/server_collect/{% if server_id %}{{ server_id }}{% else %}0{% endif %}/?ip={{ i.local_ip }}">
                                                            <button class="btn btn-danger btn-xs" type="button">
                                                                收集
                                                            </button>
                                                        </a>
                                                        <a href="/cmdb/host_update_html/?local_ip={{ i.local_ip }}">
                                                            <button class="btn btn-warning btn-xs" type="button">
                                                                更改
                                                            </button></a>
                                                        <a href="/cmdb/host_del_html/?local_ip={{ i.local_ip }}">
                                                            <button class="btn btn-danger btn-xs" type="button">
                                                                删除
                                                            </button>
                                                        </a>
                                                    </td>
                                				</tr>
                            				{% endfor %}
                            				</tbody>
                        				</table>
                    				</div>
                				</div>
    				</div>
                </div>
            </div>
        </div>
    </div>
</div>
{% endblock %}